/**
 * @FileName Client.java
 * @Package com.designMode.strategy
 * -------------------------------------
 * @function Please write description of function
 * @Date 2016-1-6 下午4:15:01
 * -------------------------------------
 * Copyright (c) 2016,顾博君 All Rights Reserved.
 */
package com.designMode.strategy;

/**
 * @author 顾博君
 * @ClassName Client
 * @Date 2016-1-6 下午4:15:01
 * @Function 场景类
 */
public class Client {
    public static void main(String[] args) {
        // 声明具体的策略
        Strategy strategy1 = new ConcreteStrategy1();
        Strategy strategy2 = new ConcreteStrategy2();
        // 声明上下文对象
        Context context = new Context();
        // 设置策略
        context.setStrategy(strategy1);
        context.doSomething();
        // 切换策略
        context.setStrategy(strategy2);
        context.doSomething();
    }
}
